/*
 * 头部导航样式文件 - Header Navigation Styles
 * 定义导航栏的外观、布局、响应式设计等样式
 */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: var(--bg-primary);
  box-shadow: 0 1px 3px var(--shadow-color);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

.container {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

.logo {
  position: absolute;
  left: 20px;
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
}

.nav {
  height: 100%;
}

.menuList {
  display: flex;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menuItem {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 15px;
  font-size: 18px; // 再增大一号：17px → 18px
  color: #4a4a4a; // 更深的颜色，原来是 var(--text-secondary) 即 #666
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px;
  margin: 0 2px;

  // 添加粉色下划线效果
  &::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #ec4899, #f472b6);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
  }

  &:hover {
    color: #ec4899;

    &::after {
      width: 80%;
      box-shadow: 0 2px 8px rgba(236, 72, 153, 30%);
    }
  }

  &.hasDropdown {
    padding-right: 25px;
  }

  &.active {
    color: #ec4899;

    &::after {
      width: 80%;
    }
  }
}

.menuLink {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdownTrigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.dropdownIcon {
  margin-left: 5px;
  font-size: 12px;
  transition: transform 0.3s ease;
}

.active .dropdownIcon {
  transform: rotate(180deg);
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 140px;
  background-color: var(--bg-primary);
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--shadow-color);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);

  &.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }
}

.dropdownMenu {
  margin: 0;
  padding: 5px 0;
  list-style: none;
}

.dropdownItem {
  padding: 12px 18px;
  font-size: 15px; // 增大一号：14px → 15px
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  margin: 2px 6px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(24, 144, 255, 10%),
      transparent
    );
    transition: left 0.5s ease;
  }

  &:hover {
    color: #1890ff;
    background-color: rgba(24, 144, 255, 8%);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 20%);

    &::before {
      left: 100%;
    }
  }

  &:active {
    transform: translateX(2px) scale(0.98);
  }
}

//搜索图标
.searchIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 21px; /* 放大图标：从18px → 22px */
  color: var(--text-primary);
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;

  &::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(24, 144, 255, 20%);
    border-radius: 50%;
    transition: all 0.4s ease;
    transform: translate(-50%, -50%);
  }

  &:hover {
    color: #1890ff;
    background-color: rgba(24, 144, 255, 10%);
    transform: scale(1.15) rotate(15deg);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 30%);

    &::before {
      width: 100%;
      height: 100%;
    }
  }

  &:active {
    transform: scale(1.05);
  }
}

.themeToggleWrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 5px;
}

.logoutButton {
  color: var(--text-primary) !important;
  margin-left: 16px;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  font-weight: 500;
  padding: 6px 16px !important;
  height: auto !important;
  background: linear-gradient(
    135deg,
    rgba(220, 38, 127, 10%),
    rgba(239, 68, 68, 10%)
  ) !important;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;

  // 添加渐变边框效果
  &::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: linear-gradient(135deg, #ec4899, #ef4444);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  // 添加光效
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 20%),
      transparent
    );
    transition: left 0.5s ease;
  }

  &:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #ec4899, #ef4444) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 40%),
      0 4px 12px rgba(239, 68, 68, 30%);
    border-color: rgba(255, 255, 255, 20%) !important;

    &::before {
      opacity: 1;
    }

    &::after {
      left: 100%;
    }
  }

  &:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 30%);
  }

  &:focus {
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 20%) !important;
  }
}
